<?php
namespace Book\Controller;

use Common\Controller\ApiController;

class BookCateController extends ApiController
{
    public function index()
    {
        $input = $this->request();
        $where['sex'] = filter($input['sex'], '1'); //适合性别，1为男生2为女生
        $cates = D('type')->scope('valid')->where($where)->order('orderby asc')->select();
        $cates = transform('BookCate', 'listview',$cates);
        $this->response($cates);
    }
}
